import request from '../utils/request';
// import { useTokenStore } from '../stores/token';

//教师登录
export const teacherLoginService = (loginData) => {
    const parms = new URLSearchParams();          
    for(let key in loginData){
        parms.append(key,loginData[key]);
    }
    return request.post('/teacher/login',parms);
}

// 教师名单查询
export const getTeacherService = (pageData) => {
    return request.get('/teacher',{params:pageData})
}

// 教师数据查询
export const getTeacherByIdService = (id) => {
    return request.get('/teacher/'+id)
}

// 教师数据新增
export const addTeacherService = (data) => {
    return request.post('/teacher/add', data)
}

export const deleteService = (id) => {
    return request.delete('/teacher/'+id)
}

// 教师数据修改
export const updateTeacherService = (data) => {
    return request.put('/teacher/update', data)
}

//教师信息
export const getTeacherDataService = () => {
    return request.get('/teacher/teacherInfo')
}
//教师修改密码
export const updatePasswordService = (data) => {
    return request.patch('/teacher/updatePwd', data)
}
